// pages/mine/mystore/storecard/cavrecord.js
Page({

    /**
     * 页面的初始数据
     */
    data: {
        tabindex: 0,
        tabs: ["已核销", "待核销", "已过期"],
        list: "",
        recordlist: [{
                img: "/images/card1.png",
                name: "2018新款布艺 车载按摩坐垫 ",
                value: "99元",
                usetime: "2018.12.31",
                status: 0,
                username: "吴先生",
                time: "2018-12-10 10:15"
            },
            {
                img: "/images/card1.png",
                name: "2018新款布艺 车载按摩坐垫 ",
                value: "99元",
                usetime: "2018.12.31",
                status: 1
            },
            {
                img: "/images/card1.png",
                name: "2018新款布艺 车载按摩坐垫 ",
                value: "99元",
                usetime: "2018.12.31",
                status: 1
            },
            {
                img: "/images/card1.png",
                name: "2018新款布艺 车载按摩坐垫 ",
                value: "99元",
                usetime: "2018.12.31",
                status: 2
            }
        ]
    },

    /**
     * 生命周期函数--监听页面加载
     */
    onLoad: function(options) {

    },

    /**
     * 生命周期函数--监听页面初次渲染完成
     */
    onReady: function() {

    },

    /**
     * 生命周期函数--监听页面显示
     */
    onShow: function() {

    },

    /**
     * 生命周期函数--监听页面隐藏
     */
    onHide: function() {

    },
	tabtap:function(e){
		var temp=this.data.recordlist;
		var index=e.currentTarget.dataset.index
		var list=[]
		for(var i=0;i<temp.length;i++){
			if(temp[i].status==index){
				list.push(temp[i])
			}
		}
		this.setData({
			list:list,
			tabindex:index
		})
	}

})